/*!
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 *
 * Modifications Copyright OpenSearch Contributors. See
 * GitHub history for details.
 */

.ouiSplitPanel {
  display: flex;
  flex-direction: column;
  min-width: 0;

  .ouiSplitPanel__inner {
    flex-basis: 0%; // Make sure they're evenly split
    // Ensure no movement if they have click handlers
    transform: none !important; // sass-lint:disable-line no-important
    box-shadow: none !important; // sass-lint:disable-line no-important
  }

  @each $modifier, $amount in $ouiPanelBorderRadiusModifiers {
    &.ouiSplitPanel-isResponsive.ouiPanel--#{$modifier} .ouiSplitPanel__inner,
    &.ouiPanel--#{$modifier} .ouiSplitPanel__inner {
      &:first-child {
        border-radius: ($amount - 1) ($amount - 1) 0 0;
      }

      &:last-child {
        border-radius: 0 0 ($amount - 1) ($amount - 1);
      }
    }
  }
}

.ouiSplitPanel--row {
  flex-direction: row;

  &.ouiSplitPanel-isResponsive {
    flex-direction: column;
  }

  @each $modifier, $amount in $ouiPanelBorderRadiusModifiers {
    &.ouiPanel--#{$modifier} .ouiSplitPanel__inner {
      &:first-child {
        border-radius: ($amount - 1) 0 0 ($amount - 1);
      }

      &:last-child {
        border-radius: 0 ($amount - 1) ($amount - 1) 0;
      }
    }
  }
}
